package cn.stylefeng.guns.sys.modular.system.quartz.task;

import cn.stylefeng.guns.sys.modular.system.service.DsstoreBillService;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

//作业不并发
@DisallowConcurrentExecution
@Component
public class DsstorebillChuQiDanDataJob implements Job {
    private Logger logger = LoggerFactory.getLogger(DsstorebillChuQiDanDataJob.class);
    @Resource
    private DsstoreBillService dsstoreBillService;

    @Override
    public void execute(JobExecutionContext arg0) {
        //每天凌晨3点获取前一天的数据入库
        try {

            logger.info("门店库存流水初期单定时任务-开始");
            ResponseData data = dsstoreBillService.initDsstorebillChuQiDanData();
            logger.info("门店库存流水初期单定时任务-结束");
        } catch (Exception e) {
            logger.info("门店库存流水定时任务，写入数据失败");
            e.printStackTrace();
        }
    }
}